<template>
  <div>
    <div class="min">
      <el-dialog title="批量编辑信息" :visible.sync="dialogVisible" @close="dialogVisibleClose" width="60%">
        <div class="dialog_div_new">
          <div class="dialog_middle">
            <div class="sub_table">
              <!-- :row-style="{ height: '30px' }"
                  :cell-style="{ padding: '0', borderColor: 'rbg(227,227,227)' }"
                  :header-cell-style="{
                    background: 'rgb(237,237,237)',
                    color: '#666',
                    textAlign: 'center',
                    borderColor: 'rbg(227,227,227)',
                  }" -->
              <!-- @row-click="onClickJggl" -->
              <el-table :data="localNewData" style="width: 100%" :border="false" max-height="450" tooltip-effect="dark" :key="dateKey">
                <el-table-column type="index" width="60" label="序号">
                  <template slot-scope="scope">
                    <div>
                      <div>{{ (scope.$index + 1).toString().padStart(2, '0') }}</div>
                    </div>
                  </template>
                </el-table-column>
                <el-table-column
                  min-width="100"
                  v-for="(item, index) in jgglColumn"
                  :key="index"
                  :prop="item.props"
                  :label="item.morenName"
                  :width="item.cellWidth"
                  :show-overflow-tooltip="true"
                  align="center"
                >
                  <template slot-scope="scope">
                    <div>
                      <div class="index_input">
                        <div
                          v-if="
                            scope.row.specType == '20' &&
                            (item.props == 'linePrice' ||
                              item.props == 'goodsPrice' ||
                              item.props == 'salesInitial' ||
                              item.props == 'goodsWeight' ||
                              item.props == 'delivery' ||
                              item.props == 'remark')
                          "
                        ></div>
                        <span v-else-if="item.props == 'jxcgoodsName'">{{
                          scope.row.xghGoods ? scope.row.xghGoods.goodsName : ''
                        }}</span>
                        <span v-else-if="item.props == 'jxcgoodsNumber'">{{
                          scope.row.xghGoods ? scope.row.xghGoods.goodsNumber : ''
                        }}</span>
                        <span v-else-if="item.props == 'stockTotal'">{{ scope.row.stockTotal }}</span>
                        <span v-else-if="item.props == 'status'">{{ scope.row.status == '10' ? '上架' : '下架' }}</span>
                        <div v-else-if="item.props == 'goodsName'">
                          <input @focusin="focusinSelect" type="text" v-model="scope.row[item.props]" :class="{ 'is-empty':!scope.row[item.props] }"/>
                        </div>
                        <div v-else-if="item.props == 'tuwen'">
                          <el-button type="text" @click="onEditRow(scope.row, scope.$index)">编辑</el-button>
                        </div>
                        <div v-else-if="item.props == 'categoryId_dictText'" class="index_select">
                          <el-select
                            v-model="scope.row.categoryId"
                            @change="
                              (val) => {
                                const selected = splbOptions.find((item) => item.categoryId === val)
                                scope.row.categoryId_dictText = selected ? selected.name : ''
                              }
                            "
                          >
                            <el-option
                              v-for="items in splbOptions"
                              :key="items.categoryId"
                              :label="items.name"
                              :value="items.categoryId"
                            ></el-option>
                          </el-select>
                        </div>
                        <div v-else-if="item.props == 'unitId_dictText'" class="index_select">
                          <!-- 如果是多规格商品，跳转编辑页面去修改 -->
                          <div v-if="scope.row.specType == '20'">
                            <el-button type="text" @click="onEditRow(scope.row,scope.$index)">编辑多规格</el-button>
                          </div>
                          <el-select
                            v-else
                            v-model="scope.row.unitId"
                            @change="
                              (val) => {
                                const selected = jbdwOptions.find((item) => item.id === val)
                                scope.row.unitId_dictText = selected ? selected.unitName : ''
                              }
                            "
                          >
                            <el-option
                              v-for="items in jbdwOptions"
                              :key="items.id"
                              :label="items.unitName"
                              :value="items.id"
                            ></el-option>
                          </el-select>
                        </div>
                        <div v-else-if="item.props == 'delivery'" class="index_select">
                          <el-select
                            v-model="scope.row.deliveryId"
                            @change="
                              (val) => {
                                const selected = yfmbOptions.find((item) => item.deliveryId === val)
                                scope.row.delivery = selected ? selected : ''
                              }
                            "
                          >
                            <el-option
                              v-for="items in yfmbOptions"
                              :key="items.deliveryId"
                              :label="items.name"
                              :value="items.deliveryId"
                            ></el-option>
                          </el-select>
                        </div>
                        <div v-else-if="item.props == 'linePrice'">
                          <input
                            style="width: 80%"
                            onkeyup="value=value.replace(/[^\d.]/g,'')"
                            @input="inputPrice(item.props, scope.row)"
                            @focusin="focusinSelect"
                            type="text"
                            v-model="scope.row.goodsSkuList[0].linePrice"
                          />
                          元
                        </div>
                        <div v-else-if="item.props == 'goodsPrice'">
                          <input
                            style="width: 80%"
                            onkeyup="value=value.replace(/[^\d.]/g,'')"
                            @input="inputPrice(item.props, scope.row)"
                            @focusin="focusinSelect"
                            type="text"
                            v-model="scope.row.goodsSkuList[0].goodsPrice"
                            :class="{ 'is-empty':item.props == 'goodsPrice' && (!scope.row.goodsSkuList[0].goodsPrice) }"
                          />
                          元
                        </div>
                        <div v-else-if="item.props == 'goodsWeight'">
                          <input
                            style="width: 80%"
                            onkeyup="value=value.replace(/[^\d.]/g,'')"
                            @input="inputPrice(item.props, scope.row)"
                            @focusin="focusinSelect"
                            type="text"
                            v-model="scope.row.goodsSkuList[0].goodsWeight"
                            :class="{ 'is-empty':scope.row.goodsSkuList[0].goodsWeight === '' || scope.row.goodsSkuList[0].goodsWeight === null || scope.row.goodsSkuList[0].goodsWeight === undefined }"
                          />
                          kg
                        </div>
                        <div v-else-if="item.props == 'salesInitial' || item.props == 'sort'">
                          <!-- 只能输入数字 -->
                          <input
                            onkeyup="value=value.replace(/[^\d]/g,'')"
                            @focusin="focusinSelect"
                            type="text"
                            v-model="scope.row[item.props]"
                          />
                        </div>
                        <div v-else>
                          <input @focusin="focusinSelect" type="text" v-model="scope.row[item.props]"/>
                        </div>
                      </div>
                    </div>
                  </template>
                </el-table-column>
              </el-table>
            </div>
          </div>
          <div class="dialog_bottom">
            <el-button  type="primary" @click.stop="onEditSubmit">保存</el-button>
            <el-button @click.stop="dialogVisibleClose">取消</el-button>
          </div>
        </div>
      </el-dialog>
    </div>
    <!-- 选择商品库 -->
    <DialogCommodityLibrary
      ref="commodityLibraryRef"
      :commodityName="newData.goodsName"
      @onSelectCommodity="onSelectCommodity"
    ></DialogCommodityLibrary>
    <!-- 新增商品弹框 -->
    <DialogCommodityAdd
      ref="commodityAddRef"
      :disableBtn="true"
      @onAddSubmit="onAddCommodity"
    ></DialogCommodityAdd>
    <!-- @dialogVisibleClose="onCloseAddCommodity"
      @onAddSubmit="onAddCommodity" -->
    <!-- 选择类别 -->
    <DialogTree ref="treeRef" :toTreeData="toTreeData" @onSelectTree="onSelectTree"></DialogTree>
    <!-- 提醒弹框 -->
    <PopupReminder ref="reminderRef" :tipsData="tipsData"></PopupReminder>
    <!-- 成功弹框 -->
    <PopupSuccess ref="successRef" :tipsData="tipsData"></PopupSuccess>
  </div>
</template>
  
<script>
import DialogCommodityAdd from './dialogCommodityShopAdd'
import { formatMoney, formatPrice, formatNumber, formatFour, delcommafy } from '@/utils/index'
import DialogCommodity from './dialogCommodity'
import DialogCommodityLibrary from './dialogCommodityLibrary'
import DialogTree from './dialogTree'
import PopupReminder from './popupReminder'
import PopupSuccess from './popupSuccess'
import { getAction, putAction, postAction } from '@/api/manage'
import { ACCOUNT_BOOK } from '@/store/mutation-types'
import Vue from 'vue'
export default {
  components: {
    DialogCommodityAdd,
    DialogCommodity,
    DialogCommodityLibrary,
    DialogTree,
    PopupReminder,
    PopupSuccess,
  },
  props: {
    newData: Array,
  },
  created() {
    this.getUnitList()
    // this.originalData = JSON.parse(JSON.stringify(this.newData)); // 深拷贝原始数据
    this.localNewData = JSON.parse(JSON.stringify(this.newData)) // 深拷贝 newData 到 localNewData
  },
  computed: {
    zdkcNum() {
      let num = 0
      this.newData.warningList.forEach((item, index) => {
        if (index != 0) {
          if (item.miniStock != '') {
            num += parseInt(item.miniStock)
          }
        }
      })
      return parseInt(num)
    },
    zgkcNum() {
      let num = 0
      this.newData.warningList.forEach((item, index) => {
        if (index != 0) {
          if (item.highStock != '') {
            num += parseInt(item.highStock)
          }
        }
      })
      return num
    },
  },
  watch: {
    newData: {
      handler(newVal) {
        this.localNewData = JSON.parse(JSON.stringify(newVal)) // 当 newData 变化时，更新 localNewData
        console.log('监听变化得到this.localNewData', this.localNewData)
      },
      deep: true,
      immediate: true,
    },
  },
  data() {
    return {
      //   originalData: [], // 原始数据
      localNewData: [], // 用于存储 newData 的本地副本
      // 账套id
      accountBookId: Vue.ls.get(ACCOUNT_BOOK).id,
      // 商品性质选项
      spxzOptions: [
        {
          value: '1',
          label: '服务',
        },
        {
          value: '2',
          label: '劳务',
        },
        {
          value: '3',
          label: '商品（无成本）',
        },
      ],
      // 传递给弹框的数据
      tipsData: {
        tipsState: '',
        tipsWords: '',
        tipsMark: '',
      },
      // 必填校验
      rules: {
        goodsName: [{ required: true, message: '请输入商品名称', trigger: 'blur' }],
        baseUnit: [{ required: true, message: '请输入基本单位', trigger: 'blur' }],
      },
      // 传递给选择类别的数据
      toTreeData: {
        module: {
          name: 'goodsTypeName', //类别名称字段
          code: 'goodsCode', //类别编码字段
          pyCode: 'goodsPinyinCode', //类别拼音码字段
          indexCode: 'goodsIndexCode', //类别排序码字段
        },
        getTreeUrl: '/goodType/treeList', //获取类别接口
        deleteTreeUrl: '/goodType/deleteById', //删除类别接口
        addTreeUrl: '/goodType/add', //新增类别接口
        editTreeUrl: '/goodType/edit', //修改类别接口
      },
      // 价格管理列名
      jgglColumn1: [
        {
          label: '单位类别',
          props: 'unitTypeName',
        },
        {
          label: '单位',
          props: 'unit',
        },
        {
          label: '换算比率',
          props: 'scale',
        },
        {
          label: '条形码',
          props: 'barCode',
        },
        { label: '规格', props: 'specs' },
        {
          label: '零售价',
          props: 'retailPrice',
        },
        {
          label: '预设售价一',
          props: 'presetPriceOne',
        },
        { label: '预售售价二', props: 'presetPriceTwo' },
        { label: '预设进价', props: 'presetBidPrice' },
        { label: '预设折扣一(%)', props: 'discountRatioOne' },
        { label: '预设折扣二(%)', props: 'discountRatioTwo' },
      ],
      jgglColumn: [
        {
          morenName: '进销存商品名称',
          zidingyiName: '',
          morenState: true,
          cellWidth: '150px',
          zidingyiState: true,
          noModify: false,
          props: 'jxcgoodsName',
          isRequired: true,
        },
        {
          morenName: '进销存商品编码',
          zidingyiName: '',
          morenState: true,
          cellWidth: '150px',
          zidingyiState: true,
          noModify: true,
          props: 'jxcgoodsNumber',
        },
        {
          morenName: '库存数量',
          zidingyiName: '',
          morenState: false,
          zidingyiState: false,
          cellWidth: '150px',
          noModify: false,
          props: 'stockTotal',
        },
        {
          morenName: '网店商品名称',
          zidingyiName: '',
          morenState: true,
          cellWidth: '150px',
          zidingyiState: true,
          noModify: false,
          props: 'goodsName',
          isRequired: true,
        },
        {
          morenName: '网店商品分类',
          zidingyiName: '',
          morenState: false,
          zidingyiState: false,
          cellWidth: '150px',
          noModify: false,
          props: 'categoryId_dictText',
        },
        {
          morenName: '商品状态',
          zidingyiName: '',
          morenState: false,
          zidingyiState: false,
          cellWidth: '150px',
          noModify: false,
          props: 'status',
        },
        {
          morenName: '网店排序值',
          zidingyiName: '',
          morenState: false,
          zidingyiState: false,
          cellWidth: '150px',
          noModify: false,
          props: 'sort',
        },
        {
          morenName: '图文详情',
          zidingyiName: '',
          morenState: false,
          zidingyiState: false,
          cellWidth: '150px',
          noModify: false,
          props: 'tuwen',
        },
        {
          morenName: '网店商品单位',
          zidingyiName: '',
          morenState: true,
          cellWidth: '150px',
          zidingyiState: true,
          noModify: false,
          props: 'unitId_dictText',
        },
        {
          morenName: '网店商品原价',
          zidingyiName: '',
          morenState: true,
          cellWidth: '150px',
          zidingyiState: true,
          noModify: false,
          props: 'linePrice',
        },
        {
          morenName: '网店商品优惠价',
          zidingyiName: '',
          morenState: true,
          cellWidth: '150px',
          zidingyiState: true,
          noModify: false,
          props: 'goodsPrice',
        },
        {
          morenName: '初始销量',
          zidingyiName: '',
          morenState: false,
          zidingyiState: false,
          cellWidth: '150px',
          noModify: false,
          props: 'salesInitial',
        },
        {
          morenName: '网店商品重量',
          zidingyiName: '',
          morenState: true,
          cellWidth: '150px',
          zidingyiState: true,
          noModify: false,
          props: 'goodsWeight',
        },
        {
          morenName: '运费模板',
          zidingyiName: '',
          morenState: false,
          zidingyiState: false,
          cellWidth: '180px',
          noModify: false,
          props: 'delivery',
        },
        {
          morenName: '网店商品备注',
          zidingyiName: '',
          morenState: false,
          zidingyiState: false,
          cellWidth: '150px',
          noModify: false,
          props: 'remark',
        },
      ],
      // 仓库预警列名
      ckyjColumn: [
        {
          label: '仓库名称',
          props: 'storehouseName',
        },
        {
          label: '最低库存',
          props: 'miniStock',
        },
        {
          label: '最高库存',
          props: 'highStock',
        },
      ],
      // 期初库存列名
      qckcColumn: [
        {
          label: '仓库名称',
          props: 'storehouseName',
        },
        {
          label: '期初库存数量',
          props: 'beginNumber',
        },
        {
          label: '期初单位成本价',
          props: 'beginPrice',
        },
        {
          label: '期初库存总金额',
          props: 'storePrice',
        },
      ],
      // 商品类别选项
      splbOptions: [],
      // 运费模板选项
      yfmbOptions: [],
      // 基本单位选项
      jbdwOptions: [],
      // 默认单位选项
      mrdwOptions: [],
      // 仓库预警表格数据
      ckyjCkmcOptions: [],
      addUnitName: '', //新增一条基本单位
      dialogVisible: false,
      ckyjIndex: -1,
      qckcIndex: -1,
      selectedCkyjCkmc: [], //已选择仓库预警的仓库名称 用来判断是否重复选择
      selectedQckcCkmc: [],

      selectRow: -1,
      dateKey: new Date().getTime(),
      originData: {
        id: '',
        goodsName: '', //商品名称
        pinyinCode: '',
        goodsNumber: '', //商品编码
        productionAddress: '', //产地
        goodsNatureId: '1', //商品性质id 1：服务、2.劳务 3.商品（无成本）
        goodsNatureName: '',
        categoryId: '', //商品类别
        xghGoodsTypeName: '',
        costCalculation: '1', //成本核算
        barCode: '', //条形码
        specs: '', //规格
        defaultUnit: '', //默认单位
        baseUnit: '', //基本单位
        multiPriceStatus: false, //多单位状态 0:开启 1:关闭
        priceStatus: true, //价格管理状态 0:开启 1:关闭
        stockWarningStatus: true, //库存预警状态 0:开启 1:关闭
        multiStockWarningStatus: false, //分库存预警状态 0:开启 1:关闭
        stockStatus: false, //期初库存状态 0:开启 1:关闭
        multiStockStatus: false, //分期初库存状态 0:开启 1:关闭

        specialFunction: false, //商品特殊功能模块，1开启，0关闭
        specialFunctionColorId: '', //
        specialFunctionColorStr: '', //
        specialFunctionSizeId: '', //关联尺码属性id（多个逗号分隔）
        specialFunctionSizeStr: '', //
        specialFunctionStr: '', //
        specialFunctionType: '', //

        goodsRemark: '', //备注
        goodsManyNorms: [
          //多单位及价格表数据
          {
            fakeId: '0',
            isDefault: '1', //是否是基本单位
            unitType: '基本单位', //单位类别 1.基本单位2.辅助单位
            unit: '', //单位
            scale: 1, //换算比例
            retailPrice: '', //零售价
            barCode: '', //条形码
            specs: '', //规格
            vipPric: '', //会员价
            presetPriceOne: '', //预设售价1
            presetPriceTwo: '', //预设售价2
            presetBidPrice: '', //预设进价
            discountRatioOne: '', //预设折扣1
            discountRatioTwo: '', //预设折扣2
            xhState: true,
          },
        ],
        goodsWarnings: [
          //仓库预警数据
          {
            fakeId: '0',
            xghStorehouseId: '', //仓库id
            xghStorehouseName: '总数量预警',
            miniStock: 0, //最低库存
            highStock: 0, //最高库存
            xhState: true,
          },
        ],
        initialInventoryInfos: [],
      },
    }
  },
  methods: {
    // 控制输入不能超过限制位数
    inputPrice(key, val) {
      //首位不能输入"."
      val[key] = val[key].replace(/^\./g, '0.')
      val[key] = val[key].replace(/\.{2,}/g, '.') //只保留第一个. 清除多余的
      val[key] = val[key].replace('.', '$#$').replace(/\./g, '').replace('$#$', '.')
      if (this.priceLength === 2) {
        // 小数点后面保留2位
        val[key] = val[key].replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3')
      } else {
        // 小数点后面保留4位
        val[key] = val[key].replace(/^(\-)*(\d+)\.(\d\d\d\d).*$/, '$1$2.$3')
      }
    },
    // 打开编辑图文详情弹窗
    // onEditRow(val) {
    //   // this.$emit('onEditRow', val)
    //   // this.$refs.commodityAddRef.show(val)
    //   this.editData = JSON.parse(JSON.stringify(val))
    //   console.log('编辑',this.editData)

    //   this.$refs.commodityAddRef.show(this.editData)
    // },
    // 触发表格修改按钮
    onEditRow(val, row) {
      this.selectRow = row
      var that = this
      // 获取商品详情
      getAction('/goods/yoshopGoods/queryById', {
        id: val.goodsId,
      }).then((res) => {
        if (res.code === 200) {
          let data = res.result
          this.xghGoodsQueryById(data, data.xghJxcGoodsId)
        } else {
          this.$elMessage({
            showClose: true,
            message: res.message,
            type: 'error',
            iconClass: 'el-icon-warning-outline',
            duration: 3000,
          })
        }
      })
    },
    xghGoodsQueryById(data, id) {
      if (!id) {
        // 处理没有id的情况
        let newData = {}
        // 初始化必要的数据结构
        newData.goodsManyNorms = this.$options.data().originData.goodsManyNorms
        // 显示表单，使用空对象作为数据
        this.$refs.commodityAddRef.setInfos([])
        this.$refs.commodityAddRef.show(newData, data, this.columnData, '1')
        return
      }
      
      getAction('/xghGoods/xghGoods/queryById', {
        id: id,
      }).then((res) => {
        if (res.code === 200) {
          let newData = res.result || {}
          // this.newData = res.result
          newData.multiPriceStatus = newData.multiPriceStatus === 'true' ? true : false
          newData.priceStatus = newData.priceStatus === 'true' ? true : false
          newData.stockWarningStatus = newData.stockWarningStatus === 'true' ? true : false
          newData.multiStockWarningStatus = newData.multiStockWarningStatus === 'true' ? true : false
          newData.stockStatus = newData.stockStatus === 'true' ? true : false
          newData.multiStockStatus = newData.multiStockStatus === 'true' ? true : false
          if (newData.goodsManyNorms && newData.goodsManyNorms.length) {
            newData.goodsManyNorms.forEach((item, index) => {
              item['xhState'] = true
              item['extendField1'] = newData.extendField1
              item['extendField2'] = newData.extendField2
              item['extendField3'] = newData.extendField3
              item['extendField4'] = newData.extendField4
              item['extendField5'] = newData.extendField5
            })
          } else {
            let obj = this.$options.data().originData.goodsManyNorms
            obj[0].unit = newData.baseUnit
            newData.goodsManyNorms = obj
          }
          newData.goodsWarnings &&
            newData.goodsWarnings.forEach((item) => {
              item['xhState'] = true
            })
          if (newData.goodsWarnings && newData.goodsWarnings.length) {
            newData.goodsWarnings[0]['storehouseName'] = '总数量预警'
          }
          newData.initialInventoryInfos &&
            newData.initialInventoryInfos.forEach((item) => {
              item['xhState'] = true
              item.costPriceShow = formatPrice(item.costPrice)
              item.numberShow = formatNumber(item.number)
              item.stockPriceShow = formatMoney(item.stockPrice)
            })
          // console.log(newData.goodsManyNorms)
          console.log("￥newData.initialInventoryInfos",newData.initialInventoryInfos)
          console.log("￥newData",newData)
          console.log("￥data",data)
          console.log("￥this.columnData",this.columnData)


          this.$refs.commodityAddRef.setInfos(newData.initialInventoryInfos || [])
          this.$refs.commodityAddRef.show(newData, data, this.columnData, '1')
        } else {
          this.$elMessage({
            showClose: true,
            message: res.message,
            type: 'error',
            iconClass: 'el-icon-warning-outline',
            duration: 3000,
          })
        }
      })
    },
    onAddCommodity(e, obj) {
      console.log('obj-----', obj, this.selectRow);
      const goodsSkuList = this.localNewData[this.selectRow].goodsSkuList;
      // 更新 goodsSkuList
      this.localNewData[this.selectRow] = {...obj, goodsSkuList};
      // 添加更新原价和优惠价的逻辑
      if (obj.goodsSku) {
        const { linePrice, goodsPrice,goodsWeight } = obj.goodsSku;
        this.localNewData[this.selectRow].goodsSkuList[0].linePrice = linePrice;
        this.localNewData[this.selectRow].goodsSkuList[0].goodsPrice = goodsPrice;
        this.localNewData[this.selectRow].goodsSkuList[0].goodsWeight = goodsWeight;
      }
      this.dateKey = new Date().getTime();
    },
    getUnitList(type) {
      if (!type || type == 'unit') {
        // 获取单位列表数据
        getAction('/xghUnit/xghUnit/list', {}).then((res) => {
          if (res.code === 200) {
            this.jbdwOptions = res.result
          } else {
            this.$elMessage.error(res.message)
          }
        })
      }

      if (!type) {
        // 获取商品类别
        getAction('/yoshopCategory/categoryAllList', { storeId: this.accountBookId }).then((res) => {
          if (res.code === 200) {
            // this.splbOptions = res.result
          let categories = res.result || [];
          let allCategories = [];

          // 递归函数，用于提取所有子级分类
          function extractCategories(categoryList) {
            categoryList.forEach(category => {
              allCategories.push(category);
              if (category.children && category.children.length > 0) {
                extractCategories(category.children);
              }
            });
          }

          extractCategories(categories);
          this.splbOptions = allCategories;
          } else {
            this.$elMessage.error(res.message)
          }
        })
        // 获取运费模板数据
        getAction('/YoshopGoods/yoshopDelivery/queryList', { storeId: this.accountBookId }).then((res) => {
          if (res.code === 200) {
            this.yfmbOptions = res.result.records
            console.log('运费模板',this.yfmbOptions)
          } else {
            this.$elMessage.error(res.message)
          }
        })
      }
    },
    //   getUnitList () {
    //     // 获取单位列表数据
    //     getAction('/goods/unitList', {
    //       unitName: this.addUnitName,
    //     }).then((res) => {
    //       if (res.code === 200) {
    //         this.jbdwOptions = res.result
    //       } else {
    //         this.$elMessage({
    //           showClose: true,
    //           message: res.message,
    //           type: 'error',
    //           iconClass: 'el-icon-warning-outline',
    //           duration: 3000,
    //         })
    //       }
    //     })
    //     // 获取主仓库数据
    //     getAction('/xghStorehouseEntity/mainStorehouse').then((res) => {
    //       if (res.code === 200) {
    //         if (this.newData && this.newData.storehouseGoodsList) {
    //           this.newData.storehouseGoodsList[0] = {
    //             id: '0',
    //             xghStorehouseId: res.result.id, //仓库id
    //             storehouseName: res.result.storehouseName,
    //             beginNumber: 0, //期初数量
    //             beginPrice: 0, //期初成本单价
    //             storePrice: 0, //库存金额
    //             xhState: true,
    //           }
    //         }
    //       } else {
    //         this.$elMessage({
    //           showClose: true,
    //           message: res.message,
    //           type: 'error',
    //           iconClass: 'el-icon-warning-outline',
    //           duration: 3000,
    //         })
    //       }
    //     })
    //     // 获取仓库列表数据
    //     getAction('/xghStorehouseEntity/allStorehouse').then((res) => {
    //       if (res.code === 200) {
    //         this.ckyjCkmcOptions = res.result
    //       } else {
    //         this.$elMessage({
    //           showClose: true,
    //           message: res.message,
    //           type: 'error',
    //           iconClass: 'el-icon-warning-outline',
    //           duration: 3000,
    //         })
    //       }
    //     })
    //   },
    // 查询商品库信息
    retrieveGoods() {
      if (this.newData && this.newData.goodsName == '') {
        this.tipsData.tipsWords = '请输入商品名称检索！'
        this.tipsData.tipsMark = 'retrieveGoods'
        this.$refs.reminderRef.dialogVisible = true
      } else {
        this.$refs.commodityLibraryRef.getData()
        this.$refs.commodityLibraryRef.dialogVisible = true
      }
    },
    // 选择当前商品数据
    onSelectCommodity(val) {
      this.newData.goodsName = val.name
      this.newData.barCode = val.barcode
      this.newData.productionAddress = val.originName
      this.newData.specs = val.specification
      this.newData.baseUnit = val.unit
      this.newData.defaultUnit = val.unit
      this.newData.manyNormsList[0].unit = val.unit
      this.unitName = val.unit
      this.getUnitList()
    },
    // 选择商品性质
    onClickSpxz(obj) {
      this.newData.goodsNatureId = obj.value
      this.newData.goodsNatureName = obj.label
    },
    // 打开选择类别弹出框
    onShowTree() {
      this.$refs.treeRef.getTreeData()
      this.$refs.treeRef.dialogVisible = true
    },
    // 选择当前类别
    onSelectTree(val) {
      this.newData.xghGoodsTypeId = val.id
      this.newData.xghGoodsTypeName = val.goodsTypeName
      this.$forceUpdate()
    },
    // 基本单位发生改变
    onChangeJbdw(val) {
      // 1.把当前选择的基本单位赋值给价格管理表第一条的单位值
      this.newData.manyNormsList[0].unit = val
      // 2.然后存储当前点击的基本单位值
      this.addUnitName = val
      // 3.去调用获取基本单位接口，由后端判断当前的基本单位值是否存在，如果不存在就是新增，存在了就是查询
      this.getUnitList()
      // 4.调用新增默认单位的方法
      this.addMrdwOptions()
    },
    // 选择其中一条基本单位
    onClickJbdw(val) {
      this.newData.manyNormsList[0].unit = val.unitName
      this.newData.defaultUnit = val.unitName
      for (let i = 1; i < this.newData.manyNormsList.length; i++) {
        if (val.unitName === this.newData.manyNormsList[i].unit) {
          this.newData.manyNormsList.splice(i, 1)
        }
      }
    },
    // 点击修改价格管理表样式
    onClickJggl(row) {
      this.newData.manyNormsList.forEach((item) => {
        if (item.id == row.id) {
          item.xhState = false
        } else {
          item.xhState = true
        }
      })
      this.$forceUpdate()
    },
    // 点击修改仓库预警表样式
    onClickCkyj(row) {
      this.newData.warningList.forEach((item, index) => {
        if (item.id == row.id) {
          this.ckyjIndex = index
          item.xhState = false
        } else {
          item.xhState = true
        }
      })
      this.$forceUpdate()
    },
    // 点击修改期初库存表样式
    onClickQckc(row) {
      this.newData.storehouseGoodsList.forEach((item, index) => {
        if (item.id == row.id) {
          this.qckcIndex = index
          item.xhState = false
        } else {
          item.xhState = true
        }
      })
      this.$forceUpdate()
    },
    // 新增弹框中表格新增一条数据
    addRow(index, mark) {
      if (mark == 'jggl') {
        this.newData.manyNormsList.forEach((item) => {
          item.xhState = true
        })
        let obj = {
          id: this.newData.manyNormsList.length,
          xhState: false,
          unitType: '2',
          unitTypeName: '辅助单位',
          unit: '',
          scale: 1,
          barCode: '',
          specs: '',
          retailPrice: '',
          presetPriceOne: '',
          presetPriceTwo: '',
          presetBidPrice: '',
          discountRatioOne: '',
          discountRatioTwo: '',
        }
        this.newData.manyNormsList.splice(index + 1, 0, obj)
      }
      if (mark == 'ckyj') {
        this.newData.warningList.forEach((item) => {
          item.xhState = true
        })
        let obj = {
          id: this.newData.warningList.length,
          xhState: false,
          storehouseName: '',
          miniStock: 0,
          highStock: 0,
        }
        this.newData.warningList.splice(index + 1, 0, obj)
        this.ckyjIndex = this.newData.warningList.length - 1
      }
      if (mark == 'qckc') {
        this.newData.storehouseGoodsList.forEach((item) => {
          item.xhState = true
        })
        let obj = {
          id: this.newData.storehouseGoodsList.length,
          xhState: false,
          storehouseName: '',
          beginNumber: '',
          beginPrice: '',
          storePrice: '',
        }
        this.newData.storehouseGoodsList.splice(index + 1, 0, obj)
        this.qckcIndex = this.newData.storehouseGoodsList.length - 1
      }
    },
    // 新增弹框中表格删除当前行数据
    deleteRow(index, mark) {
      if (mark == 'jggl') {
        this.newData.manyNormsList.splice(index, 1)
      }
      if (mark == 'ckyj') {
        this.newData.warningList.splice(index, 1)
      }
      if (mark == 'qckc') {
        this.newData.storehouseGoodsList.splice(index, 1)
      }
    },
    // 价格管理中选择其中一条基本单位
    onClickTableJbdw(val, tableIndex) {
      for (let i = 0; i < this.mrdwOptions.length; i++) {
        if (val.unitName === this.mrdwOptions[i].unitName) {
          this.$elMessage({
            showClose: true,
            message: '不可选择重复的单位！',
            type: 'error',
            iconClass: 'el-icon-warning-outline',
            duration: 3000,
          })
          this.newData.manyNormsList[tableIndex].unit = ''
          return
        }
      }
      this.addMrdwOptions()
    },
    // 新增默认单位的方法
    addMrdwOptions() {
      this.mrdwOptions = []
      let str = JSON.stringify(this.newData.manyNormsList)
      let arr = JSON.parse(str)
      let newArr = this.unique(arr)
      newArr.forEach((item) => {
        this.mrdwOptions.push({
          unitName: item.unit,
        })
      })
    },
    // 数组去重
    unique(arr) {
      const res = new Map()
      return arr.filter((arr) => !res.has(arr.unit) && res.set(arr.unit, 1))
    },
    // 仓库预警中选择选择其中一条仓库名称
    onSelectCkyjCkmc(data) {
      for (let i = 0; i < this.selectedCkyjCkmc.length; i++) {
        if (data.storehouseName == this.selectedCkyjCkmc[i].storehouseName) {
          this.$elMessage({
            showClose: true,
            message: '不可选择重复的仓库名称！',
            type: 'error',
            iconClass: 'el-icon-warning-outline',
            duration: 3000,
          })
          this.newData.warningList[this.ckyjIndex].xghStorehouseId = ''
          this.newData.warningList[this.ckyjIndex].storehouseName = ''
          return
        } else {
          this.newData.warningList[this.ckyjIndex].xghStorehouseId = data.id
          this.newData.warningList[this.ckyjIndex].storehouseName = data.storehouseName
        }
      }
      this.addSelectedCkyjCkmc()
    },
    // 新增已选择仓库的方法
    addSelectedCkyjCkmc() {
      this.selectedCkyjCkmc = []
      let str = JSON.stringify(this.newData.warningList)
      let arr = JSON.parse(str)
      let newArr = this.uniqueCk(arr)
      newArr.forEach((item) => {
        this.selectedCkyjCkmc.push(item)
      })
    },
    // 数组去重
    uniqueCk(arr) {
      const res = new Map()
      return arr.filter((arr) => !res.has(arr.id) && res.set(arr.id, 1))
    },
    // 期初仓库中选择其中一条仓库名称
    onSelectQckcCkmc(data) {
      for (let i = 0; i < this.selectedQckcCkmc.length; i++) {
        if (data.storehouseName == this.selectedQckcCkmc[i].storehouseName) {
          this.$elMessage({
            showClose: true,
            message: '不可选择重复的仓库名称！',
            type: 'error',
            iconClass: 'el-icon-warning-outline',
            duration: 3000,
          })
          this.newData.storehouseGoodsList[this.qckcIndex].xghStorehouseId = ''
          this.newData.storehouseGoodsList[this.qckcIndex].storehouseName = ''
          return
        } else {
          this.newData.storehouseGoodsList[this.qckcIndex].xghStorehouseId = data.id
          this.newData.storehouseGoodsList[this.qckcIndex].storehouseName = data.storehouseName
        }
      }
      this.addSelectedQckcCkmc()
    },
    // 新增已选择仓库的方法
    addSelectedQckcCkmc() {
      this.selectedQckcCkmc = []
      let str = JSON.stringify(this.newData.storehouseGoodsList)
      let arr = JSON.parse(str)
      let newArr = this.uniqueCk(arr)
      newArr.forEach((item) => {
        this.selectedQckcCkmc.push(item)
      })
    },
    onEditSubmit() {
      let that = this
      console.log('this.newData', this.newData)
      console.log('this.localNewData', this.localNewData)
      //判断修改后的表格数据中的goodsname、goodsPrice、goodsWeight是否为空，如果为空的话点保存时对应的input框显示红边框，并提示请输入完整信息
    let hasEmpty = false;
    // 如果是单规格specType=10就多判断 'goodsPrice', 'goodsWeight'
    this.localNewData.forEach((row) => {
    const propsToCheck = ['goodsName'];
    if (row.specType === 10) {
      propsToCheck.push('goodsPrice', 'goodsWeight');
      //单规格往后端传 
      row.goodsSku = {
        "id": row.goodsSkuList[0].id,
        "goodsId": row.goodsId,
        "linePrice": row.goodsSkuList[0].linePrice,
        "goodsPrice": row.goodsSkuList[0].goodsPrice,
        "goodsWeight": row.goodsSkuList[0].goodsWeight,
      }
    }
    propsToCheck.forEach((prop) => {
        // 特殊处理允许0值的字段
      if (prop === 'goodsWeight') {
        // 检查是否为undefined、null或空字符串，0视为有效
        if (row.goodsSkuList[0][prop] === undefined || row.goodsSkuList[0][prop] === null || row.goodsSkuList[0][prop] === '') {
          hasEmpty = true;
        }
      } else if(prop === 'goodsPrice'){
        if (!row.goodsSkuList[0][prop]) {
          hasEmpty = true;
        }
      }else {
        // 其他字段检查是否存在有效值
        if (!row[prop]) {
          hasEmpty = true;
        }
      }
    });

  });
   // 检查 goodsName 是否重复
   const goodsNames = this.localNewData.map(row => row.goodsName);
  const hasDuplicate = new Set(goodsNames).size!== goodsNames.length;
  if (hasDuplicate) {
    const duplicateName = goodsNames.find(name => goodsNames.filter(n => n === name).length > 1);
    this.$message.error(`网店商品名称 ${duplicateName} 已经存在，请你修改`);
    return;
  }
    if (hasEmpty) {
    this.$message.error('请输入完整信息');
    return;
    }
    console.log('this.localNewData', this.localNewData)
      postAction('/goods/yoshopGoods/editBatch', this.localNewData).then((res) => {
        if (res.code === 200) {
          // 添加成功后，将成功后的商品信息返回到列表页面
          this.tipsData.tipsWords = res.result
          this.$refs.successRef.dialogVisible = true
          that.$emit('onQuery')
          this.dialogVisible = !this.dialogVisible
        } else {
          this.$elMessage({
            showClose: true,
            message: res.message,
            type: 'error',
            iconClass: 'el-icon-warning-outline',
            duration: 3000,
          })
        }
      })
    },
    // 合计列计算
    getSummaries(param) {
      const { columns, data } = param
      const sums = []
      columns.forEach((column, index) => {
        if (index === 0) {
          sums[index] = '合计'
        } else if (
          column.property == 'beginNumber' ||
          column.property == 'beginPrice' ||
          column.property == 'storePrice'
        ) {
          const values = data.map((item) => delcommafy(item[column.property]))
          if (!values.every((value) => isNaN(value))) {
            sums[index] = values.reduce((prev, curr) => {
              const value = delcommafy(curr)
              if (!isNaN(value)) {
                return prev + curr
              } else {
                return prev
              }
            }, 0)
            sums[index] = this.$formatMoney(sums[index])
          }
        } else {
          sums[index] = ''
        }
      })
      return sums
    },
    // 新增数据中表格内输入框聚焦时选中
    focusinSelect() {
      event.target.select()
    },
    // 关闭事件发射
    dialogVisibleClose() {
      this.dialogVisible = false
      this.localNewData = JSON.parse(JSON.stringify(this.newData)) // 恢复原始数据
      //   this.$emit('dialogVisibleClose')
    },
  },
}
</script>
  
<style lang="scss" scoped>
.min{

.is-empty {
  border: 1px solid red !important;
}
::v-deep .el-table {
  thead {
    height: 50px;
  }
}
::v-deep .el-table__header {
  th {
    background-color: transparent !important;
  }
}
::v-deep .el-dialog {
  .el-dialog__body {
    padding: 0;
  }
  .el-dialog__header {
    width: 100%;
    height: 0.937559rem;
    box-sizing: border-box;
    padding: 0 0.375023rem;
    border-bottom: 1px solid #eeeeee;
    display: flex;
    align-items: center;
    justify-content: space-between;
    span {
      font-size: 0.300019rem;
      color: #666;
      font-weight: 600;
    }
    .el-dialog__headerbtn {
      position: static;
      .el-icon-close {
        color: #999;
        font-size: 0.48753rem;
      }
    }
  }
}
.dialog_div_new {
  width: 100%;
  height: 60vh;
  overflow: auto;
  background: #fff;
  .dialog_middle {
    height: calc(100% - 1.12507rem);
    margin-top: 0;
    padding-bottom: 0;
    box-sizing: border-box;
    padding: 0 0.375023rem 0.281268rem;
    overflow: auto;
    div {
      p {
        margin: 0;
        //   font-size: 0.225014rem;
        font-family: PingFang SC;
        font-weight: 400;
        color: #666666;
      }
      input {
        flex: 1;
        height: 0.562535rem;
        background: #ffffff;
        border: 1px solid #e3e3e3;
        border-radius: 0.075005rem;
        font-size: 0.225014rem;
        color: #666;
        box-sizing: border-box;
        padding: 0 0.187512rem;
        &:focus {
          outline: none;
          border-color: #1890ff;
        }
      }
      ::v-deep .el-select {
        flex: 1;
        .el-input {
          .el-input__inner {
            height: 0.562535rem;
            background: #ffffff;
            border: 1px solid #e3e3e3;
            border-radius: 0.075005rem;
            //   font-size: 0.225014rem;
            color: #666;
            box-sizing: border-box;
            padding: 0 0.187512rem;
          }
          .el-input__suffix {
            right: 8%;
            height: 0.562535rem;
            display: flex;
            align-items: center;
          }
        }
      }
    }
    .line_detailedAddress {
      input {
        width: calc(100% - 1.031314rem);
        border-radius: 0.075005rem 0 0 0.075005rem;
        border-right: none;
      }
      ::v-deep .el-button {
        width: 1.031314rem;
        height: 0.562535rem;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.225014rem;
        background: #1890ff;
        border-radius: 0 0.075005rem 0.075005rem 0;
      }
    }
    .input_switch {
      display: flex;
      height: 0.562535rem;
      margin-top: 0.281268rem;
      div {
        flex: 1;
        display: flex;
        align-items: center;
        margin-right: 0.562535rem;
        p {
          font-size: 0.262516rem;
          color: #1893fc;
          width: 0.937559rem;
          width: 1.12507rem;
          text-align: justify;
          text-justify: distribute-all-lines; /*ie6-8*/
          text-align-last: justify; /* ie9*/
          -moz-text-align-last: justify; /*ff*/
          -webkit-text-align-last: justify; /*chrome 20+*/
        }
        ::v-deep .el-switch {
          margin-left: 0.225014rem;
          flex: 0;
          .el-switch__core {
            width: 0.562535rem;
            height: 0.281268rem;
          }
          .el-switch__core::after {
            width: 0.243765rem;
            height: 0.243765rem;
            top: 0;
            left: 0;
          }
        }
        ::v-deep .el-switch.is-checked .el-switch__core::after {
          left: 100%;
          margin-left: -0.243765rem;
        }
        ::v-deep .el-checkbox {
          .el-checkbox__label {
            font-size: 0.225014rem;
          }
        }
        span {
          color: #fd6c21;
          font-size: 0.225014rem;
          margin-left: 0.562535rem;
        }
      }
    }
    .input_textarea {
      display: flex;
      align-items: flex-start;
      margin-top: 0.281268rem;
      p {
        width: 0.937559rem;
        text-align: justify;
        text-justify: distribute-all-lines; /*ie6-8*/
        text-align-last: justify; /* ie9*/
        -moz-text-align-last: justify; /*ff*/
        -webkit-text-align-last: justify; /*chrome 20+*/
      }
      textarea {
        margin-left: 0.375023rem;
        flex: 1;
        background: #ffffff;
        border: 1px solid #e3e3e3;
        border-radius: 0.075005rem;
        font-size: 0.225014rem;
        color: #666;
        box-sizing: border-box;
        padding: 0.187512rem;
        &:focus {
          outline: none;
          border-color: #1890ff;
        }
      }
    }
    .sub_table {
      width: 100%;
      overflow-x: auto;
      margin-top: 0.187512rem;
      ::v-deep .el-table {
        td,
        th {
          padding: 0;
          .cell {
            white-space: nowrap;
            //   font-size: 16px;
            color: #666;
            text-align: center;
            input {
              padding: 0 0.112507rem;
            }
            .first_line {
              color: #1893fc;
            }
            .index_select {
              display: flex;
              align-items: center;
              width: 100%;
              .el-select {
                width: 100%;
                .el-input {
                  display: flex;
                  height: 0.431277rem;
                  // font-size: 16px;
                  .el-input__inner {
                    height: 0.431277rem;
                    //   font-size: 16px;
                    color: #666;
                    border-radius: 0;
                  }
                  .el-input__icon {
                    line-height: 0.431277rem;
                  }
                  .el-input__suffix {
                    height: 0.431277rem;
                    line-height: 0.431277rem;
                  }
                }
              }
            }
            .index_input {
            //   display: flex;
            //   align-items: center;
            //   width: 100%;
              p {
                width: 100%;
                text-align: center;
                margin: 0;
              }
              input {
                width: 100%;
                height: 0.431277rem;
                border-radius: 0;
                font-size: 14px;
              }
            }
          }
        }
        .first_index_button {
          width: 100%;
          height: 100%;
          display: flex;
          align-items: center;
          justify-content: center;
          i {
            font-size: 0.375023rem;
            color: #1893fc;
          }
        }
        .index_button {
          width: 100%;
          height: 100%;
          display: flex;
          align-items: center;
          justify-content: space-between;
          i {
            font-size: 0.375023rem;
            &:first-child {
              color: #1893fc;
            }
            &:last-child {
              color: #fd5050;
            }
          }
        }
        .el-table__body tr:hover > td {
          background: #e3f6ff;
        }
        //滚动条的宽度
        ::-webkit-scrollbar {
          width: 8px;
          height: 10px;
          background-color: #e5e5e5;
        }
        //滚动条的滑块
        ::-webkit-scrollbar-thumb {
          background-color: #c9c9c9;
        }
      }
    }
    .input_line {
      display: flex;
      height: 0.562535rem;
      margin-top: 0.281268rem;
      div {
        width: 32%;
        display: flex;
        align-items: center;
        box-sizing: border-box;
        &:first-child {
          margin-right: 2%;
        }
        &:last-child {
          margin-left: 2%;
        }
        ::v-deep .el-select {
          margin-left: 0.375023rem;
        }
      }
      > div {
        > p:first-child {
          display: block;
          width: 0.937559rem;
          text-align: justify;
          text-justify: distribute-all-lines; /*ie6-8*/
          text-align-last: justify; /* ie9*/
          -moz-text-align-last: justify; /*ff*/
          -webkit-text-align-last: justify; /*chrome 20+*/
        }
        input {
          margin-left: 0.375023rem;
        }
      }
      .line_dialog {
        width: 32%;
        .dialog_input {
          flex: 1;
          position: relative;
          display: flex;
          align-items: center;
          justify-content: flex-end;
          ::v-deep .el-select {
            margin-right: 0;
            .el-select-dropdown__item {
              p {
                margin: 0;
              }
            }
            i {
              display: none;
            }
          }
          i {
            position: absolute;
            margin-right: 0.187512rem;
            color: #bfbfbf;
            font-size: 0.281268rem;
            cursor: pointer;
          }
        }
      }
    }
  }
  .dialog_bottom {
    width: 100%;
    height: 1.12507rem;
    box-sizing: border-box;
    padding: 0 0.187512rem;
    display: flex;
    align-items: center;
    justify-content: center;
    // ::v-deep .el-button {
    //   width: 1.12507rem;
    //   height: 0.562535rem;
    //   text-align: center;
    //   box-sizing: border-box;
    //   display: flex;
    //   align-items: center;
    //   justify-content: center;
    //   font-size: 0.225014rem;
    //   border-radius: 0.093756rem;
    //   background: #fff;
    //   border: 1px solid #dddddd;
    //   color: #666666;
    // }
    // ::v-deep .el-button--primary {
    //   background: #1890ff;
    //   border-color: #1890ff;
    //   color: #fff;
    //   margin-right: 0.112507rem;
    // }
    // ::v-deep .el-button--default {
    //   margin-left: 0.112507rem;
    // }
  }
}
::v-deep .el-form-item {
  display: flex;
  width: 100%;
  margin-bottom: 0;
  .el-form-item__label {
    width: 1.218826rem;
    line-height: 0.562535rem;
    font-size: 0.225014rem;
    font-family: PingFang SC;
    font-weight: 400;
    color: #666;
    text-align: justify;
    text-justify: distribute-all-lines; /*ie6-8*/
    text-align-last: justify; /* ie9*/
    -moz-text-align-last: justify; /*ff*/
    -webkit-text-align-last: justify; /*chrome 20+*/
    position: relative;
    &::before {
      position: absolute;
      right: 0;
      margin-right: 0;
      color: #ff0000;
      font-weight: 600;
    }
  }
  .el-form-item__content {
    margin-left: 8px;
    flex: 1;
    height: 0.562535rem;
    display: flex;
    align-items: center;
    .el-input {
      width: 100%;
      height: 100%;
      display: flex;
      align-items: center;
      .el-input__inner {
        height: 100%;
        padding: 0 0.187512rem;
        //   font-size: 0.225014rem;
        //   font-size: 12px;

        color: #666;
      }
    }
  }
  &:first-child {
    margin-right: 2%;
  }
  &:last-child {
    margin-left: 2%;
  }
}
.form_div {
  width: 100%;
  height: 0.562535rem;
  display: flex;
  margin-top: 0.375023rem;
  .line_dialog {
    ::v-deep .el-form-item__content {
      position: relative;
      > i {
        position: absolute;
        right: 0.187512rem;
        color: #bfbfbf;
      }
    }
    .scan_p {
      position: absolute;
      right: 0.187512rem;
      > span {
        color: #1890ff;
        margin-left: 0.093756rem;
      }
    }
  }
  .spmc_div {
    ::v-deep .el-form-item__content {
      flex: 1;
      .el-input {
        width: calc(100% - 1.031314rem);
        .el-input__inner {
          border-radius: 0.075005rem 0 0 0.075005rem;
          border-right: none;
        }
      }
      .el-button {
        width: 1.031314rem;
        height: 0.562535rem;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.225014rem;
        background: #1890ff;
        border-radius: 0 0.075005rem 0.075005rem 0;
      }
    }
  }
  .disable_input {
    ::v-deep .el-input__inner {
      background-color: #ededed;
      border: 1px solid #e3e3e3;
      border-radius: 0.075005rem;
      font-size: 0.225014rem;
      font-family: PingFang SC;
      font-weight: 400;
      color: #666666;
    }
  }
}
}
</style>